import React from 'react';
import AmpStoriesOutlined from '@material-ui/icons/AmpStoriesOutlined';
import { NavView, get_mod, loc, NavListSub } from 'sui';
import { SideAutoView, SideHandView } from './view';

const model = (cfg) => {
    const fix = [
        {uid: "side.hand", view: SideHandView, value: loc("l_446")},
        {uid: "side.auto", view: SideAutoView, value: loc("l_756")},
    ];

    return get_mod(cfg, fix, "side");
};

const Side = ({ mod, sideopen, cfg }) => <NavView cfg={cfg} model={model(cfg)} mod={mod} sideopen={sideopen} name="side"/>;

const NavSide = (props) => <NavListSub icon={<AmpStoriesOutlined/>} sub={model(props.cfg)} {...props} scut={15}/>;

export {NavSide, Side};
